{% extends 'ThemeBundle:Default:base.html.twig' %}
{% block contenido %}
{{parent()}}
<h1>Alta de Empresas</h1>
<div class="well bs-component col-lg-10">
    <form class="form-horizontal" action="{{ path('empresas_create') }}" method="post" {{ form_enctype(form) }}>
        {% set domicilio_proto %}



        <td>{{ form_widget(form.domicilio.vars.prototype.calle) }}</td>
        <td>{{ form_widget(form.domicilio.vars.prototype.numero) }}</td>
        <td>{{ form_widget(form.domicilio.vars.prototype.depto) }}</td>
        <td>{{ form_widget(form.domicilio.vars.prototype.piso) }}</td>
        <td>{{ form_widget(form.domicilio.vars.prototype.provincia) }}</td>
        <td>{{ form_widget(form.domicilio.vars.prototype.localidad) }}</td>
        <td class="action"></td>


{% endset %}
        <fieldset>   
{#{{ form_widget(form) }}#}

            <div id="midbox" class="curvyRedraw">
 {#{{ form_widget(form) }}#}

{{ form_errors(form) }}
            {#{{ form_label(form) }}#}
            {#{{ form_errors(form) }}
            {{ form_widget(form) }}#}
            {{ form_row(form.nombreEmpresa) }}
            {{ form_row(form.personaContacto) }}
            {{ form_row(form.telContacto) }}
            {{ form_row(form.mailContacto) }}
            {{ form_row(form.paginaWeb) }}

{#                <ul class="domicilio" data-prototype="{{ form_widget(form.domicilio.vars.prototype)|e }}">#}
                <fieldset>
                    <div class="col-lg-15">
                        <legend>Domicilio</legend>                    

                        <table class="domicilio table" data-prototype="{{ domicilio_proto |e }}">
        {# itera sobre cada etiqueta existente y reproduce su único campo: name #}
                            <tbody>
                                <tr>
                                    <td><label>Calle </label></td>
                                    <td><label>Numero </label></td>
                                    <td><label>Depto </label></td>
                                    <td><label>Piso </label></td>
                                    <td><label>Provincia </label></td>
                                    <td><label>Localidad </label></td>
                                    <td><label>Accion</label></td>
                                </tr>
        {# itera sobre cada etiqueta existente y reproduce su único campo: name #}
        {% for domicilios in form.domicilio %}


                                <tr>
{#                            {{ form_widget(domicilios) }}#}

                                    <td>{{ form_widget(domicilios.calle) }}</td>
                                    <td>{{ form_widget(domicilios.numero) }}</td>
                                    <td>{{ form_widget(domicilios.depto) }}</td>
                                    <td>{{ form_widget(domicilios.piso) }}</td>
                                    <td>{{ form_widget(domicilios.provincia) }}</td>
                                    <td>{{ form_widget(domicilios.localidad) }}</td>
                                    <td class="action"></td>
                                </tr>


        {% endfor %}
                            <div hidden>    {{form_rest(form)}}</div>
                            </tbody>
                        </table>
                    </div>
                </fieldset>
                <script type="text/javascript" src="{{asset('bundles/theme/js/jQuery.min.js')}}"></script>
{% include 'CurriculumBundle:Curriculum:curriculum_jquery_block.html.twig' %}
        </fieldset>

        <div class="record_actions pull-right">
            <button class="btn btn-primary" type="submit">Guardar</button>
            <a class="btn btn-default" href="{{ path('empresas') }}">
                Volver
            </a>

        </div>
    </form>
</div>


{% endblock %}
